home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / dev / c / libiconv_src.lha / tests / check-stateless.cmd < prev    next >
Encoding:
Text File  |  2000-11-07  |  1.0 KB  |  44 lines

  1. /*
  2.  * check-stateless
  3.  *
  4.  *      Complete check of a stateless encoding.
  5.  *      Usage: check-stateless SRCDIR CHARSET
  6.  */
  7.  
  8. IF RxFuncQuery('SysLoadFuncs') THEN DO
  9.    CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  10.    CALL SysLoadFuncs
  11. END
  12.  
  13. '@echo off'
  14.  
  15. PARSE ARG srcdir charset
  16.  
  17. '.\table-from 'charset' > tmp-'charset'.TXT'
  18. '.\table-to 'charset' | sort > tmp-'charset'.INVERSE.TXT'
  19. 'cmp 'srcdir'\'charset'.TXT tmp-'charset'.TXT'
  20.  
  21. IF exists(srcdir'\'charset'.IRREVERSIBLE.TXT') = 1 THEN
  22.     DO
  23.         'cat 'srcdir'\'charset'.TXT 'srcdir'\'charset'.IRREVERSIBLE.TXT | sort | uniq -u > tmp-orig-'charset'.INVERSE.TXT'
  24.         'cmp tmp-orig-'charset'.INVERSE.TXT tmp-'charset'.INVERSE.TXT'
  25.     END
  26. ELSE 
  27.     DO
  28.         'cmp 'srcdir'\'charset'.TXT tmp-'charset'.INVERSE.TXT'
  29.     END
  30.  
  31. 'rm -f tmp-'charset'.TXT tmp-'charset'.INVERSE.TXT tmp-orig-'charset'.INVERSE.TXT'
  32.  
  33. EXIT
  34.  
  35. /*
  36.  * exists - check if file exists
  37.  */
  38.  
  39. exists: PROCEDURE
  40.     IF STREAM(ARG(1), 'C', 'QUERY EXISTS') = '' THEN
  41.         RETURN 0
  42.     ELSE
  43.         RETURN 1
  44.